package Week3.num.week3Test1.method;

public class Homework03 {
    public static void main(String[] args) {
        System.out.println("大于200的最小质数为"+prime());
    }

    public static int prime(){
        int i=200;
        while(true){
            //标记写循环内
            //每次循环都要重置标记
            boolean isPrime=true;
            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    isPrime=false;
                    break;
                }
            }
            if(isPrime){
                System.out.println("i");
                return i;
            }else {
                i++;
            }
        }
    }
}
